package chatGUI;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

/**
 * @author Michael & Pierre
 */
/**
 * Action Listener called when the connected window's Disconnect button is clicked 
 */
public class DisconnectionClickListener implements ActionListener {

	/**
	 * To keep track of the calling platform-specific GUI
	 */
	JavaGUI javaGUILoopback;
	
	/**
	 * Constructor to memorize the calling platform-specific GUI's address
	 * @param gui
	 */
	public DisconnectionClickListener(JavaGUI gui) {
		this.javaGUILoopback = gui;
	}
	
	/**
	 * Demands the calling platform-specific GUI to perform the disconnection.
	 * @param arg0
	 */
	@Override
	public void actionPerformed(ActionEvent arg0) {
        javaGUILoopback.disconnect();
	}

}
